import hx.display.MovieClip;
import hx.display.Sprite;

/**
 * 动画播放器
 */
class Player extends Sprite {
	/**
	 * 动画列表
	 */
	public var animates:Map<String, MovieClip> = [];

	/**
	 * 播放某个动作
	 * @param action 
	 */
	public function play(action:String):Void {
		trace("开始播放", action);
		this.removeChildren();
		var mc = animates.get(action);
		mc.reset();
		mc.play();
		this.addChild(mc);
	}
}
